<%--
  Created by IntelliJ IDEA.
  User: winaya
  Date: 2016/9/12
  Time: 15:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<script type="text/javascript" src="<s:url value="/js/laytpl/laytpl.js"/>"
        charset="UTF-8"></script>
<div class="dashedbar text-blue">
    <span>商品信息</span>
</div>
<div id="view"></div>

<table id="hggoods_input_table" style="width: 99%"
       class="pn-ftable table-bordered table-condensed table">
    <tr>
        <th>
            <span><span class="mustRemark">*</span>商品序号</span>
        </th>
        <td>
            <input type="hidden" showIndex="0" fieldName="id" id="hggoods_id"/>
            <input
                    id="goodshow_serid" type="text" value=""
                    showIndex="1"
                    fieldName="" fieldName="" readonly="readonly" name=""
                    notClear="notClear"/>
            <input value="1" type="hidden" id="hggoods_spxh"
                   readonly="readonly" atitle="海关商品-商品序号"
                   showIndex="0"
                   fieldName=""/>
            <input type="hidden"
                   value="" id="hggoods_hwxh"
                   readonly="readonly" atitle="海关商品-商品序号"
                   showIndex="0"
                   fieldName="spxh"/>
        </td>
        <th>
            <span>合同商品项目序号</span>
        </th>
        <td colspan="2">
            <input type="text"
                   id="hggoods_htspxmxh" style="width: 100%"
                   atitle="海关商品-合同商品项目序号" showIndex="2"
                   fieldName="htspxmxh" value="" name="contractNumber"
                   onblur="numbercheck(this,0,999999999,'',0)"
                   maxlength="9"/>
            <%--{{d.contractNumber}--%>
        </td>
        <th>
            <span><span class="mustRemark">*</span>商品编号</span>
        </th>
        <td colspan="4">
<span class="textbox combo" style=" height: 20px;">
<span class="textbox-addon textbox-addon-right"
      style="right: 0px;">
<a href="javascript:void(0)" onclick="initSelect($(this));" class="textbox-icon combo-arrow"
   style="width:18px; height: 20px;"></a>
</span>
<input class="textbox-text validatebox-text textbox-prompt" type="text" placeholder=""
       autocomplete="off"
       style="padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
       id="hggoodsSelect_spbh_show"
       value=""
       onfocus="initByFocus($(this));"/>
</span>
            <input id="hggoodsSelect_spbh" atitle="海关商品-商品编号"
                   valueId="hggoods_spbh" keyId="hggoods_spbhdm"
                   style="display: none;" isSelect="1"
                   selectData="co_sphsbm" theKey="HSCODE" theValue="ID" name=""
                   value=""/>
            <input type="hidden" id="hggoods_spbh" class="hgGoodRequired" showIndex="0"
                   fieldName="spbh"/>
            <input type="hidden" id="hggoods_spbhdm" showIndex="3" fieldName=""/>
        </td>
    </tr>
    <tr>
        <th>
            <span><span class="mustRemark">*</span>商品名称</span>
        </th>
        <td colspan="4">
            <input type="text" id="hggoods_spmc" showIndex="4"
                   fieldName="spmc" class="hgGoodRequired"
                   value="" name=""
                   atitle="海关商品-商品名称" maxlength="255"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>规格型号</span>
        </th>
        <td colspan="4">
            <input type="text" value="" name="" id="hggoods_spggxh"
                   atitle="海关商品-规格型号" class="hgGoodRequired"
                   showIndex="0" fieldName="spggxh" maxlength="255"
                   onchange="changeUpper(this)"/>
            <input type="hidden" id="hggoods_otherTds" showIndex="99"/>
        </td>
    </tr>
    <tr>
        <th>
            <span><span class="mustRemark">*</span>计价单位</span>
        </th>
        <td>
            <input type="text" id="valuation_unit"
                   class="hgGoodRequired" value="" name="unit" atitle="海关商品-计价单位"
                   maxlength="255"
                   showIndex="3" fieldName="spmc"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>计价数量</span>
        </th>
        <td>
            <input type="text"
                   id="valuation_quantity"
                   class="hgGoodRequired" value="" name=""
                   atitle="海关商品-计价数量" maxlength="250" showIndex="3"
                   fieldName=""/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>法定单位</span>
        </th>
        <td>
            <input type="text"
                   id="legal_unit" class="hgGoodRequired" name=""
                   value="" atitle="海关商品-法定单位"
                   maxlength="255" showIndex="3"
                   fieldName=""/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>法定数量</span>
        </th>
        <td>
            <input type="text"
                   id="legal_count" name=""
                   class="hgGoodRequired" value=""
                   atitle="海关商品-法定数量" maxlength="255" showIndex="3"
                   fieldName=""/>
        </td>
        <th>
            <span>工激费</span>
        </th>
        <td>
            <input type="text"
                   id="legal_quantity" name=""
                   class="hgGoodRequired" value=""
                   atitle="海关商品-工激费" maxlength="255" showIndex="3"
                   fieldName=""/>
        </td>
    </tr>
    <tr>
        <th>
            <span><span class="mustRemark">*</span>申报数量</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_sbsl" style="width: 100%" name=""
                   value="" atitle="海关商品-申报数量" showIndex="6"
                   fieldName="sbsl"
                   onblur="numbercheck(this,0,99999999999999,'',5);caclulateHgGoodPrice();"
                   class="hgGoodRequired"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>申报计量单位</span>
        </th>
        <td>
<span class="textbox combo" style=" height: 20px;">
<span class="textbox-addon textbox-addon-right"
      style="right: 0px;">
<a href="javascript:void(0)" onclick="initSelect($(this));" class="textbox-icon combo-arrow"
   style="width:18px; height: 20px;"></a>
</span>
<input class="textbox-text validatebox-text textbox-prompt" type="text" placeholder=""
       autocomplete="off"
       style=" padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
       id="hggoodsSelect_sbjldw_show" value="" name="unit"
       onfocus="initByFocus($(this));"/>
</span>
            <input id="hggoodsSelect_sbjldw" atitle="海关商品-申报计量单位"
                   width="80px"
                   valueId="hggoods_sbjldw"
                   keyId="hggoods_sbjldwName" style="display: none;"
                   isSelect="1" name="total_price"
                   selectData="hg_co_jldw"
                   theKey="SHOWNAME" theValue="ID"
                   value=""/>
            <input type="hidden"
                   id="hggoods_sbjldw"
                   class="hgGoodRequired"
                   showIndex="0"
                   fieldName="sbjldw"/>
            <input type="hidden"
                   id="hggoods_sbjldwName" showIndex="7"
                   fieldName=""/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>总价</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_zj" class="hgGoodRequired" name="total_price"
                   atitle="海关商品-总价" showIndex="0" fieldName="zj" value=""
                   onblur="numbercheck(this,0,999999999999999,'',2);caclulateHgGoodPrice();"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>单价</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_dj" style="width: 100%" name="unit_price"
                   atitle="海关商品-单价" showIndex="0" fieldName="dj"
                   onblur="numbercheck(this,0,99999999999,'',4)"
                   value=""
                   class="hgGoodRequired"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>币制</span>
        </th>
        <td>
            <span class="textbox combo" style=" height: 20px;">
	 <span class="textbox-addon textbox-addon-right" style="right: 0px;">
		<a href="javascript:void(0)" onclick="initSelect($(this),null,false);"
           class="textbox-icon combo-arrow" style="width: 18px; height: 20px;"></a>
	</span>
	<input class="textbox-text validatebox-text textbox-prompt" type="text" placeholder=""
           autocomplete="off"
           style=" padding-top: 3px; padding-bottom: 3px; margin-right: 18px; margin-left: 0px;color:black;"
           id="hggoodsSelect_bz_show"
           onfocus="initByFocus($(this));"/>
</span>
            <input id="hggoodsSelect_bz" atitle="海关商品-币制" width="90px" valueId="hggoods_bz"
                   keyId="hggoods_bzName" style="display: none;" isSelect="1" selectData="hg_co_bz"
                   theKey="SHOWNAME"
                   theValue="HGDM" value=""/>
            <input type="hidden" id="hggoods_bz" class="hgGoodRequired" showIndex="0"
                   fieldName="bz"/>
            <input type="hidden" id="hggoods_bzName" showIndex="0" fieldName=""/>
        </td>
    </tr>
    <tr>
        <th>
            <span><span class="mustRemark">*</span>第一数量</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_dysl" class="hgGoodRequired" name="firstCount"
                   atitle="海关商品-第一数量" value=""
                   onblur="numbercheck(this,0,99999999999999,'',5);"
                   showIndex="0"
                   fieldName="dysl"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>第一计量单位</span>
        </th>
        <td>
<span class="textbox combo" style=" height: 20px;">
<span class="textbox-addon textbox-addon-right"
      style="right: 0px;">
<a id="dyjldwAId" href="javascript:void(0)"
   onclick="initSelect($(this));"
   class="textbox-icon combo-arrow" style="width:18px; height: 20px;"></a>
</span>
<input class="textbox-text validatebox-text textbox-prompt" type="text" placeholder=""
       autocomplete="off"
       style=" padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
       readOnly="readOnly" value=""
       id="hggoodsSelect_dyjldw_show"
       onfocus="initByFocus($(this));"/>
</span>
            <input
                    id="hggoodsSelect_dyjldw" atitle="海关商品-第一计量单位"
                    width="80px" name="firstUnit"
                    style="display: none;"
                    valueId="hggoods_dyjldw" keyId="hggoods_dyjldwName"
                    readonly="readonly" isSelect="1"
                    selectData="hg_co_jldw" theKey="SHOWNAME"
                    theValue="ID"
                    value=""/>
            <input type="hidden"
                   id="hggoods_dyjldw"
                   class="hgGoodRequired"
                   showIndex="0"
                   fieldName="dyjldw"/>
            <input type="hidden"
                   id="hggoods_dyjldwName" showIndex="0"
                   fieldName=""/>
        </td>

        <%----------------------------------------- 出口-目的国  --------------------------------------%>
        <c:if test="${table=='export'}">
            <%---------------目的国  ---------%>
            <th>
                <span><span class="mustRemark">*</span>目的国</span>
            </th>
            <td>
                <span class="textbox combo" style=" height: 20px;">
                    <span class="textbox-addon textbox-addon-right"
                          style="right: 0px;">
                          <a href="javascript:void(0)"
                             onclick="initSelect($(this),null,false);"
                             class="textbox-icon combo-arrow"
                             style="width:18px; height: 20px;"></a>
                    </span>
                        <input class="textbox-text validatebox-text textbox-prompt"
                               type="text"
                               placeholder=""
                               autocomplete="off"
                               style=" padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
                               id="hggoods_mdgName_show"
                               value=""
                               onfocus="initByFocus($(this));"/>
                </span>
                <input atitle="海关商品-目的国(地区)"
                       style="display: none;"
                       valueId="hggoods_mdg"
                       keyId="hggoods_mdgName"
                       isSelect="1"
                       id="hggoodsSelect_mdg"
                       selectData="hg_co_gjdm" theKey="SHOWNAME"
                       theValue="ID"
                       name=""/>
                <input type="hidden"
                       id="hggoods_mdg"
                       class="hgGoodRequired"
                       showIndex="0"
                       fieldName="ycgmdg"/>
                <input type="hidden"
                       id="hggoods_mdgName"
                       showIndex="0" fieldName=""/>
            </td>
            <%----原产国  --------------------%>
            <th colspan="1">
                <span><span class="mustRemark">*</span>原产国</span>
            </th>
            <td style="" colspan="1">
                <span class="textbox combo" style=" height: 20px;">
                    <span class="textbox-addon textbox-addon-right" style="right: 0px;">
                        <a href="javascript:void(0)" onclick="initSelect($(this),null,false);"
                           class="textbox-icon combo-arrow" style="width: 18px; height: 20px;"></a>
                    </span>
                    <input class="textbox-text validatebox-text textbox-prompt" type="text"
                           placeholder=""
                           autocomplete="off"
                           style=" padding-top: 3px; padding-bottom: 3px; margin-right: 18px; margin-left: 0px;color:black;"
                           value=""
                           title="(142)中国(CHINA)"
                           id="hggoods_ycgName_show"
                           onfocus="initByFocus($(this));"/></span>
                <input id="hggoodsSelect_country"
                       value=""
                       atitle="海关商品-原产国"
                       name=""
                       style="display: none;"
                       selectData="hg_co_gjdm" theKey="SHOWNAME" style="diplay:none;"
                       defaultValue="43" defaultText="(142)中国(CHINA)"
                       theValue="ID" value=""
                       valueId="hggoods_ycg"
                       keyId="hggoods_ycgName"/>

                <input type="hidden"
                       id="hggoods_ycg"
                       value="43" showIndex="0"
                       fieldName="destinationCountry" class="hgGoodRequired goodRequiredClass "/>
                <input type="hidden" id="hggoods_ycgName" showIndex="0" value=""/>
            </td>
        </c:if>
        <%----------------------------------------- 进口  --------------------------------------%>
        <c:if test="${table=='entry'}">
            <%----------------------------------------- 原产国  --------------------------------------%>
            <th>
                <span><span class="mustRemark">*</span>原产国</span>
            </th>
            <td>
                <span class="textbox combo" style=" height: 20px;">
                <span class="textbox-addon textbox-addon-right"
                      style="right: 0px;"><a href="javascript:void(0)"
                                             onclick="initSelect($(this),null,false);"
                                             class="textbox-icon combo-arrow"
                                             style="width:18px; height: 20px;"></a>
                </span>
                <input class="textbox-text validatebox-text textbox-prompt" type="text"
                       placeholder=""
                       autocomplete="off"
                       style=" padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
                       id="hggoods_mdgName_show"
                       value=""
                       onfocus="initByFocus($(this));"/>
            </span>
                <input atitle="原产国" style="display: none;"
                       valueId="hggoods_ycg"
                       keyId="hggoods_ycgName"
                       isSelect="1"
                       id="hggoodsSelect_ycg"
                       selectData="hg_co_gjdm" theKey="SHOWNAME"
                       theValue="ID"
                       name=""/>
                <input type="hidden"
                       id="hggoods_ycg"
                       class="hgGoodRequired"
                       showIndex="0"
                       fieldName="ycgmdg"/>
                <input type="hidden"
                       id="hggoods_ycgName"
                       showIndex="0" fieldName=""/>
            </td>
            <%-----------------------------------------目的国  --------------------------------------%>
            <th colspan="1"><span><span class="mustRemark">*</span>目的国(地区)</span>
            </th>
            <td style="" colspan="1">
                <span class="textbox combo" style=" height: 20px;">
                <span class="textbox-addon textbox-addon-right" style="right: 0px;">
                    <a id="" href="javascript:void(0)" onclick="initSelect($(this),null,false);"
                       class="textbox-icon combo-arrow" style="width: 18px; height: 20px;"></a>
                </span>
                <input class="textbox-text validatebox-text textbox-prompt" type="text"
                       placeholder=""
                       autocomplete="off"
                       style=" padding-top: 3px; padding-bottom: 3px; margin-right: 18px; margin-left: 0px;color:black;"
                       value=""
                       title="(142)中国(CHINA)"
                       id="hggoods_mdgName_show"
                       onfocus="initByFocus($(this));"/>
            </span>
                <input id="hggoodsSelect_destination"
                       value=""
                       atitle="目的国(地区)"
                       name=""
                       style="display: none;"
                       selectData="hg_co_gjdm" theKey="SHOWNAME" style="diplay:none;"
                       defaultValue="43" defaultText="(142)中国(CHINA)"
                       theValue="ID" value=""
                       valueId="hggoods_mdg"
                       keyId="hggoods_mdgName"/>

                <input type="hidden"
                       id="hggoods_mdg"
                       value="43" showIndex="0"
                       fieldName="destinationCountry" class="hgGoodRequired goodRequiredClass "/>
                <input type="hidden"
                       id="hggoods_mdgName"
                       showIndex="0"
                       value=""/>
            </td>
        </c:if>


        <th>
            <span><span class="mustRemark">*</span>征免</span>
        </th>
        <td colspan="1">
<span class="textbox combo" style=" height: 20px;">
<span class="textbox-addon textbox-addon-right"
      style="right: 0px;">
<a href="javascript:void(0)"
   onclick="initSelect($(this),null,false);"
   class="textbox-icon combo-arrow" style="width:18px; height: 20px;"></a>
</span>
<input class="textbox-text validatebox-text textbox-prompt" type="text" placeholder=""
       autocomplete="off"
       style=" padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
       id="hggoodsSelect_zm_show" value=""
       onfocus="initByFocus($(this));"/>
</span>
            <input atitle="海关商品-征免" valueId="hggoods_zm"
                   keyId="hggoods_zmName" style="display: none;"
                   isSelect="1" name=""
                   id="hggoodsSelect_zm"
                   selectData="co_hgzmfs"
                   theKey="SHOWNAME" theValue="ID"
                   value=""/>
            <input type="hidden"
                   id="hggoods_zm" class="hgGoodRequired"
                   showIndex="0"
                   fieldName="zm"/>
            <input type="hidden"
                   id="hggoods_zmName" showIndex="0"
                   fieldName=""/>
        </td>
    </tr>
    </tr>
    <tr>
        <th>
            <span>第二数量</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_desl" style="width: 100%"
                   atitle="海关商品-第二数量" showIndex="0" fieldName="desl"
                   onblur="numbercheck(this,0,99999999999999,'',5)"/>
        </td>
        <th>
            <span>第二计量单位</span>
        </th>
        <td>
<span class="textbox combo" style=" height: 20px;">
<span class="textbox-addon textbox-addon-right"
      style="right: 0px;">
<a href="javascript:void(0)"
   onclick="initSelect($(this));"
   class="textbox-icon combo-arrow" style="width:18px; height: 20px;"></a>
</span>
<input class="textbox-text validatebox-text textbox-prompt" type="text" placeholder=""
       autocomplete="off"
       style=" padding-top: 3px; padding-bottom: 3px;margin-right: 18px; margin-left: 0px;color:black;"
       id="hggoodsSelect_dejldw_show"
       value=""
       onfocus="initByFocus($(this));"/>
</span>
            <input id="hggoodsSelect_dejldw" atitle="海关商品-第二计量单位"
                   isSelect="1"
                   valueId="hggoods_dejldw"
                   keyId="hggoods_dejldwName" style="display: none;" isSelect="1"
                   selectData="hg_co_jldw"
                   theKey="SHOWNAME" theValue="ID"
                   name="" value=""/>
            <input type="hidden"
                   id="hggoods_dejldw" showIndex="0"
                   fieldName="dejldw"/>
            <input type="hidden" id="hggoods_dejldwName" showIndex="0" fieldName=""/>
        </td>
        <th>
            <span>版本号</span>
        </th>
        <td>
            <input type="text" id="hggoods_bbh" style="width: 100%" atitle="海关商品-版本号"
                   class="{nLength:[0,8]}" maxlength="8"
                   value="" name="version_no"
                   showIndex="0"
                   fieldName="bbh"/>
        </td>
        <th>
            <span>货号</span>
        </th>
        <td>
            <input type="text" id="hggoods_hh" style="width: 100%"
                   value="" name=""
                   atitle="海关商品-货号"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>包装种类</span>
        </th>
        <td colspan="1">
            <input type="text" atitle="海关商品-包装种类" value="" id="hggoods_bzzl"/>
        </td>
    </tr>
    <tr>
        <th>
            <span><span class="mustRemark">*</span>毛重</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_mz"
                   class="{required:true}"
                   onblur="numbercheck(this,0,99999999999999,'',5);adjustGrossAndNet();"
                   value="" name=""
                   atitle="海关申报-毛重(KG)"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>净重</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_jz"
                   class="{required:true}"
                   onblur="numbercheck(this,0,99999999999999,'',5);adjustGrossAndNet();"
                   value="" name=""
                   atitle="海关申报-净重(KG)"/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>箱唛</span>
        </th>
        <td>
            <input type="text" class="hgGoodRequired" atitle="海关商品-箱唛" maxlength="255"
                   showIndex="3"
                   id="hggoods_xm"
                   fieldName="" name="carton"
                   value=""/>
        </td>
        <th>
            <span>装箱单备注内容</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_zxdbznr"
                   class="hgGoodRequired"
                   atitle="海关商品-装箱单备注内容" maxlength="255" showIndex="3"
                   value="" name="" fieldName=""/>
        </td>
        <th>
            <span><span class="mustRemark">*</span>包装件数</span>
        </th>
        <td>
            <input type="text"
                   id="hggoods_bzjs"
                   class="hgGoodRequired" atitle="海关商品-包装件数" maxlength="255" showIndex="3"
                   value="" name="" fieldName=""/>
        </td>
    </tr>
</table>

<ul class="add_but" style="width:99%">
    <li id="addAttach" class="">
        <input type="button" id="hggoods_addButton" value="添加" onclick="addOrUpdateHggoods()"/>
        <img src="<s:url value="/cargodecl/images/add.png"/>"/>
    </li>
</ul>

<table id="hgGoodtable" style="width:99%" class="table_attach">
    <tr style="background-color:#53a4ea">
        <th style="width: 5%;">序号</th>
        <th style="width: 5%;">合同商品项目序号</th>
        <th style="width: 18%;">商品编号</th>
        <th>商品名称</th>
        <th style="width: 8%;">申报数量</th>
        <th style="width: 12%;">申报计量单位</th>
        <th style="width: 5%;">其他</th>
        <th style="width: 21%;">操作</th>
    </tr>
    <c:forEach items="${declaration.commodities}" var="commodity" varStatus="cin">
        <tr id="hggoods_TR${cin.index}" onclick="editHggoodsTr(${cin.index})" class="hggoods_TR">
                <%--------------------- 选中商品 jsp下拉框赋值----------------------------%>
            <input size="10" id="hggoodsSelect_dejldw_show_${cin.index}"
                   value="${commodity.second_unit}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoodsSelect_sbjldw_show_${cin.index}"
                   value="${commodity.measureUnit}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoodsSelect_bz_show_${cin.index}"
                   value="${commodity.currency}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoodsSelect_dyjldw_show_${cin.index}"
                   value="${commodity.firstUnit}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoodsSelect_dyjldw_show_${cin.index}"
                   value="${commodity.firstUnit}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoodsSelect_zm_show_${cin.index}"
                   value="${commodity.levymode}" type="hidden" readonly="readonly"/>

            <input size="10"
                   id="hggoods_mdg_${cin.index}"
                   name="commodities[${cin.index}].destination_code"
                   value="${commodity.destination_code}" type="hidden" readonly="readonly"/>
            <input size="10"
                   id="hggoods_mdgName_${cin.index}"
                   name="commodities[${cin.index}].destination"
                   value="${commodity.destination}"
                   type="hidden" readonly="readonly"/>

            <input size="10"
                   id="hggoods_ycg_${cin.index}"
                   name="commodities[${cin.index}].origin_country_code"
                   value="${commodity.origin_country_code}" type="hidden" readonly="readonly"/>
            <input size="10"
                   id="hggoods_ycgName_${cin.index}"
                   name="commodities[${cin.index}].origin_country"
                   value="${commodity.origin_country}"
                   type="hidden" readonly="readonly"/>

                <%--------------------- 隐藏商品详细信息----------------------------%>
            <input size="10" id="index_id_${cin.index}" name="commodities[${cin.index}].id"
                   value="${commodity.id}"
                   type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_dejldw_${cin.index}"
                   name="commodities[${cin.index}].second_unit"
                   value="${commodity.second_unit}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_sbjldw_${cin.index}"
                   name="commodities[${cin.index}].measureUnit"
                   value="${commodity.measureUnit}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_spggxh_${cin.index}"
                   name="commodities[${cin.index}].goods_mode"
                   value="${commodity.goods_mode}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_hh_${cin.index}"
                   name="commodities[${cin.index}].goods_no"
                   value="${commodity.goods_no}" type="hidden" readonly="goods_no"/>
            <input size="10" id="valuation_unit_${cin.index}"
                   name="commodities[${cin.index}].salesUnit"
                   value="${commodity.salesUnit}" type="hidden" readonly="readonly"/>
            <input size="10" id="valuation_quantity_${cin.index}"
                   name="commodities[${cin.index}].salesSum"
                   value="${commodity.salesSum}" type="hidden" readonly="readonly"/>
            <input size="10" id="legal_unit_${cin.index}"
                   name="commodities[${cin.index}].legal_unit"
                   value="${commodity.legal_unit}" type="hidden" readonly="readonly"/>
            <input size="10" id="legal_count_${cin.index}"
                   name="commodities[${cin.index}].legal_count"
                   value="${commodity.legal_count}" type="hidden" readonly="readonly"/>
            <input size="10" id="legal_quantity_${cin.index}"
                   name="commodities[${cin.index}].processing_fee"
                   value="${commodity.processing_fee}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_zj_${cin.index}"
                   name="commodities[${cin.index}].total_price" class="total_price"
                   value="${commodity.total_price}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_dj_${cin.index}"
                   name="commodities[${cin.index}].unit_price"
                   value="${commodity.unit_price}" type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_bz_${cin.index}"
                   name="commodities[${cin.index}].currency"
                   value="${commodity.currency}" type="hidden"
                   readonly="readonly"/> <%-- 币制下拉框bug--%>
            <input size="10" id="hggoods_dysl_${cin.index}"
                   name="commodities[${cin.index}].firstCount"
                   value="${commodity.firstCount}"
                   type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_dyjldw_${cin.index}"
                   name="commodities[${cin.index}].firstUnit"
                   value="${commodity.firstUnit}" type="hidden"
                   readonly="readonly"/> <%-- 第一计量单位 下拉框--%>
            <input size="10" id="hggoods_zm_${cin.index}"
                   name="commodities[${cin.index}].levymode"
                   class="goods_number" value="${commodity.levymode}"
                   type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_desl_${cin.index}"
                   name="commodities[${cin.index}].second_count"
                   value="${commodity.second_count}"
                   type="hidden" readonly="readonly"/> <%--下拉框--%>
            <input size="10" id="hggoods_bbh_${cin.index}"
                   name="commodities[${cin.index}].version_no"
                   value="${commodity.version_no}"
                   type="hidden" readonly="readonly"/>
            <input size="10" id="hggoods_jz_${cin.index}" class="goods_net_weight"
                   name="commodities[${cin.index}].goods_net_weight"
                   value="${commodity.goods_net_weight}"
                   type="hidden" readonly="readonly"/>
            <input size="10"
                   id="hggoods_mz_${cin.index}" class="goods_gross_weight"
                   name="commodities[${cin.index}].goods_gross_weight"
                   type="hidden" readonly="readonly"/>
            <input size="10"
                   id="hggoods_xm_${cin.index}"
                   name="commodities[${cin.index}].boxMark"
                   value="${commodity.boxMark}"
                   type="hidden" readonly="readonly"/>
            <input size="10"
                   id="hggoods_bzjs_${cin.index}"
                   name="commodities[${cin.index}].goods_number"
                   value="${commodity.goods_number}" class="goods_numbers"
                   type="hidden" readonly="readonly"/> <%--件数总汇--%>
            <input size="10" id="hggoodsSelect_spbh_show_${cin.index}"
                   value="${commodity.code_t}"
                   type="hidden"
                   readonly="readonly" class="valid">


                <%--------------------- 列表显示的商品详细信息----------------------------%>
            <td><input size="10" id="goodshow_serid_${cin.index}"
                       name="commodities[${cin.index}].index_num"
                       value="${commodity.index_num}" readonly="readonly"/>
            </td>
            <td><input size="10" id="hggoods_htspxmxh_${cin.index}"
                       name="commodities[${cin.index}].contractNumber"
                       value="${commodity.contractNumber}" readonly="readonly"/></td>
            <td><input size="10" id="hggoods_spbh_${cin.index}"
                       name="commodities[${cin.index}].code_t"
                       value="${commodity.code_t}" readonly="readonly" class="valid"></td>
            <td><input size="10" id="hggoods_spmc_${cin.index}"
                       name="commodities[${cin.index}].name"
                       value="${commodity.name}" readonly="readonly" class="valid"></td>
            <td><input size="10" id="hggoods_sbsl_${cin.index}"
                       name="commodities[${cin.index}].count"
                       value="${commodity.count}" readonly="readonly"/>
            </td>
            <td><input size="10" id="hggoods_bzzl_${cin.index}"
                       name="commodities[${cin.index}].package_type"
                       value="${commodity.package_type}"
                       readonly="readonly"/></td>
            <td><input size="10" id="hggoods_zxdbznr_${cin.index}"
                       name="commodities[${cin.index}].packinglist_remark"
                       value="${commodity.packinglist_remark}"
                       readonly="readonly"/>
            </td>
            <td>
                <a href="#" onclick='javascript:upGoods(this);'>上移</a>
                <a href="#" onclick='javascript:upGoods(this);'>下移</a>
                <a href="#" id="good_copyButton" class="enterIndex" onclick="copyHgGood()">复印</a>
                <img src="../cargodecl/images/delete.gif"
                     onclick="delHggoodsTr('hggoods_TR${cin.index}')">
            </td>
        </tr>
    </c:forEach>
    <script>setGoodsSpxhId(${declaration.commodities.size()})</script>
    <tr id="hggoods_lastTR" height="22px;">
        <td colspan="8">
            <span style="margin:30px;">件数总汇:&nbsp;<font id="numberCount"></font> 件</span>
            <span style="margin:30px;"> 毛重总汇: &nbsp;<font id="grossCount"></font> 千克</span>
            <span style="margin:30px;"> 净重总汇: &nbsp;<font id="netCount"></font> 千克</span>
            <span style="margin:30px;"> 总价总汇: &nbsp;<font id="priceCount"></font> 币制</span>
        </td>
    </tr>
</table>

<script>
    reSetShowSerid();

    var numberCount = 0; //件数总汇
    $(".goods_numbers").each(function () {
        numberCount += parseInt($(this).val());
    });
    $("#numberCount").html(numberCount);

    var grossCount = 0; //毛重总汇
    $(".goods_gross_weight").each(function () {
        grossCount += parseInt($(this).val());
    });
    $("#grossCount").html(grossCount);

    var netCount = 0;//净重总汇
    $(".goods_net_weight").each
    (function () {
        netCount += parseInt($(this).val());
    });
    $("#netCount").html(netCount);

    var priceCount = 0;//净重总汇
    $(".total_price").each(function () {
        priceCount += parseInt($(this).val());
    });
    $("#priceCount").html(priceCount);
</script>
